/*
-------------------------------------------------

	Sound.h

	Dmitriy Kuzmenko (Dgut)

-------------------------------------------------
*/

#ifndef __AUTUMN_SOUND_H__
#define __AUTUMN_SOUND_H__

#include "OpenAL.h"

namespace Autumn
{

class OGG;

class Sound
{
	ALuint						id;
public:
								Sound( void );
								Sound( const OGG * ogg );
								~Sound( void );

	inline const ALuint			GetID( void ) const;

	void						Init( ALenum format, const ALvoid * data, ALsizei size, ALsizei frequency );
};

inline const ALuint Sound::GetID( void ) const
{
	return id;
}

const int						STREAM_NUM_BUFFERS = 4;
const int						STREAM_BUFFER_SIZE = 0x4000;

class Stream
{
	Sound						sounds[ STREAM_NUM_BUFFERS ];
	int							current;

	OGG *						ogg;
public:
								Stream( OGG * ogg );
								~Stream( void );

	const ALuint				GetNextChunk( void );
	void						Rewind( void );
};

}	// namespace Autumn

#endif	// !!! __AUTUMN_SOUND_H__ !!!